@extends('layouts.default')
@section('seo-title', $seo['seo_title'])
@section('seo-description',$seo['seo_description'])
@section('seo-keywords',$seo['seo_keyword'])
@section('company',$all_model['abbreviation'])
@section('content')
    @include('layouts._headerElse')
    <div class="container cpMain">
        <div class="container col-lg-12">
            <div class="nlist col-lg-3">
                <!--热点推荐开始-->
                <div class="contactn mt10 mb10">
                    <div class="t05">
                        <p>热点推荐</p>
                    </div>
                    <div class="subnr">
                        <ul>
                            @foreach($hot as $item)
                                <li style="list-style: none">
                                    <a href="{{route('newsDetails', [$item['id']])}}"
                                       title="{{$item['title']}}">{{$item['title']}}</a>
                                </li>
                            @endforeach
                        </ul>
                    </div>
                </div>
                <!--热点推荐结束-->
            </div>
            <div class="cpright newsPage col-lg-9">
                <!--文章列表开始-->
                <div class="list clearfix">
                    @foreach($news as $item)
                        <div class="item container">
                            <a href="{{route('newsDetails', [$item['id']])}}" title="{{$item['title']}}">
                                <img class="col-sm-12" src="{{$url.'/' .$item['image']}}" alt="{{$item['title']}}">
                                <div class="col-sm-12">
                                    <h3>{{$item['title']}}</h3>
                                    <div class="txt">
                                        {{$item['description']}}<span>[详情]</span>
                                    </div>
                                    <div class="time">日期：{{$item['created_at']}} 阅读量：{{$item['pv']}}</div>
                                </div>
                            </a>
                        </div>
                    @endforeach
                </div>
                <!--文章列表结束-->
                <!--分页样式-->
                <div class="row no-gutters mt-5">
                    <div class="col text-center">
                        <div class="block-27">
                            <ul>
                                <li><a href="{{ $news->url(1) }} "
                                       style="{{ ($news->currentPage() == 1) ? ' pointer-events: none;' : '' }}">&lt;</a>
                                </li>
                                @for ($i = 1; $i <= $news->lastPage(); $i++)
                                    <li class="{{ ($news->currentPage() == $i) ? ' active' : '' }}">
                                        <span>{{ $i }}</span></li>
                                @endfor
                                <li><a href="{{ $news->url($news->currentPage()+1) }}  "
                                       style="{{ ($news->currentPage() == $news->lastPage()) ? ' pointer-events: none;' : '' }}   ">&gt;</a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
